{{template "header.html" .}}

<h1>Validation sample 1</h1>

{{if .errors}}
<div class="error">
	<h2>Oops, please correct these errors</h2>
	<ul>
		{{range .errors}}
			<li>{{.}}</li>
		{{end}}
	</ul>
</div>
{{end}}

<form action="/Sample1/HandleSubmit" method="POST">
	<fieldset>
		<legend>User informations</legend>

		<div class="field">
			<label for="username">Desired username :</label>
			<input id="username" type="text" name="username" value="{{.flash.username}}" />
		</div>

		<div class="field">
			<label for="firstname">First name :</label>
			<input id="firstname" type="text" name="firstname" size="30" value="{{.flash.firstname}}" />
		</div>

		<div class="field">
			<label for="lastname">Last name :</label>
			<input id="lastname" type="text" name="lastname" size="30" value="{{.flash.lastname}}" />
		</div>

		<div class="field">
			<label for="age">Age :</label>
			<input id="age" type="text" name="age" size="3" value="{{.flash.age}}" />
		</div>

	</fieldset>
	<fieldset>
		<legend>Password</legend>

		<div class="field">
			<label for="password">Password :</label>
			<input id="password" type="password" name="password" value="{{.flash.password}}" />
		</div>

		<div class="field">
			<label for="passwordConfirm">Confirm password :</label>
			<input id="passwordConfirm" type="password" name="passwordConfirm" value="{{.flash.passwordConfirm}}" />
		</div>

	</fieldset>
	<fieldset>
		<legend>Email</legend>

		<div class="field">
			<label for="email">Email address :</label>
			<input id="email" name="email" size="30" value="{{.flash.email}}" />
		</div>

		<div class="field">
			<label for="emailConfirm">Confirm email address :</label>
			<input id="emailConfirm" name="emailConfirm" size="30" value="{{.flash.emailConfirm}}" />
		</div>

	</fieldset>
	<fieldset>
		<legend>Conditions</legend>

		<div class="infos">
			Checking this box indicates that you accept terms of use.
			If you do not accept these terms, do not use this website :
		</div>

		<div class="field">
			<label for="termsOfUse">I accept terms of use :</label>
			<input id="termsOfUse" type="checkbox" value="true" name="termsOfUse" {{if .flash.termsOfUse}}checked="true"{{end}} />
		</div>

	</fieldset>

	<input type="submit" class="submit" value="Join !" />
</form>

{{template "footer.html" .}}
